The definition of a method with a name which is already used by another method in the same visibility score redefines or overloads the older method.

To redefine a method the following conditions must be fullfilled:

  • Equal names of the methods.
  • Equal parameter- and return type profiles; the data types of the parameter values and -in case of a function- the data type of the return value have to be the same.
  • Equal parameter names and -modes; the names and assigned modes (in, out, inout) of the parameters have to be the same.
  • Equal parameter classes (constant, variable, signal).
Example

In contrast to redefinition for overloading the following conditions have to be fullfilled:

  • Equal names of the methods.
  • Parameter and return type profiles have to be differnt.
Example

Note:

Of course, class attributes can only be redefined and not overloaded!